// 对外暴露配置路由（放置常量路由） 所有人都可以访问的
export const constantRoute = [
  {
    path: '/login',
    component: () => import('@/view/login/index.vue'),
    name: 'Login', //命名路由
    meta: {
      title: '登录',
      hidden: true, //true为隐藏 false为不隐藏
    },
  },
  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    name: 'Layout', //命名路由
    meta: {
      title: '',
      hidden: false,
      icon: '', //菜单左侧图标
    },
    redirect: '/home', //重定向到指定页面
    children: [
      {
        path: '/home',
        component: () => import('@/view/home/index.vue'),
        name: 'Home', //命名路由
        meta: {
          title: '首页',
          hidden: false,
          icon: 'HomeFilled',
        },
      },
    ],
  },
  {
    path: '/404',
    component: () => import('@/view/404/index.vue'),
    name: '404', //命名路由
    meta: {
      title: '404',
      hidden: true,
    },
  },
  {
    path: '/screen',
    component: () => import('@/view/screen/index.vue'),
    name: 'Screen', //命名路由
    meta: {
      title: '数据大屏',
      hidden: false,
      icon: 'Monitor',
    },
  },
]

// 这里是动态路由 不同用户登录后展示的不同
export const asyncRoute = [
  {
    path: '/acl',
    component: () => import('@/layout/index.vue'),
    name: 'Acl', //命名路由
    redirect: '/acl/user',
    meta: {
      title: '权限管理',
      hidden: false,
      icon: 'Lock',
    },
    children: [
      {
        path: '/acl/user',
        component: () => import('@/view/acl/user/index.vue'),
        name: 'User', //命名路由
        meta: {
          title: '用户管理',
          hidden: false,
          icon: 'Avatar',
        },
      },
      {
        path: '/acl/role',
        component: () => import('@/view/acl/role/index.vue'),
        name: 'Role', //命名路由
        meta: {
          title: '角色管理',
          hidden: false,
          icon: 'User',
        },
      },
      {
        path: '/acl/permission',
        component: () => import('@/view/acl/permission/index.vue'),
        name: 'Permission', //命名路由
        meta: {
          title: '菜单管理',
          hidden: false,
          icon: 'Grid',
        },
      },
    ],
  },
  {
    path: '/product',
    component: () => import('@/layout/index.vue'),
    name: 'Product', //命名路由
    redirect: '/product/attr',
    meta: {
      title: '商品管理',
      icon: 'Goods',
    },
    children: [
      {
        path: '/product/trademark',
        component: () => import('@/view/product/trademark/index.vue'),
        name: 'Trademark', //命名路由
        meta: {
          title: '品牌管理',
          icon: 'ShoppingCart',
        },
      },
      {
        path: '/product/attr',
        component: () => import('@/view/product/attr/index.vue'),
        name: 'Attr', //命名路由
        meta: {
          title: '属性管理',
          icon: 'Orange',
        },
      },
      {
        path: '/product/spu',
        component: () => import('@/view/product/spu/index.vue'),
        name: 'Spu', //命名路由
        meta: {
          title: 'SPU管理',
          icon: 'DataAnalysis',
        },
      },
      {
        path: '/product/sku',
        component: () => import('@/view/product/sku/index.vue'),
        name: 'Sku', //命名路由
        meta: {
          title: 'SKU管理',
          icon: 'Histogram',
        },
      },
    ],
  },
]

// 任意路由
export const anyRoute = [
  {
    path: '/pathMatch(.*)*', //任意路由
    redirect: '/404',
    name: 'Any', //命名路由
    meta: {
      title: '任意页面',
      hidden: true,
    },
  },
]
